home *** CD-ROM | disk | FTP | other *** search
/ Clipper Collection / Clipper Collection.iso / clipper7 / nannws34.arc / DRIVE.PRG < prev    next >
Text File  |  1989-01-01  |  807b  |  25 lines

  1. * Function: CurDrive()
  2. * Author:   Steve Hillbourne
  3. * Version:  Clipper Summer '87
  4. * Note(s):  Returns the current drive letter using only
  5. *           Clipper source code.
  6. *
  7. * Copyright (c) 1988 Nantucket Corp.
  8.  
  9. FUNCTION CurDrive
  10. PRIVATE drive, position, row, col
  11. SET CURSOR OFF
  12. row = ROW()                     && Save row.
  13. col = COL()                     && Save column.
  14.  
  15. RUN VOL>drive.txt               && Get the drive by saving
  16.                                 ** the results of DOS's VOL
  17. drive = MEMOREAD("drive.txt")   && command to a file and
  18. position = AT("d", drive) + 6   && extracting the drive letter.
  19. drive = SUBSTR(drive, position, 1)
  20.  
  21. ERASE drive.txt                 && Cleanup.
  22. SET CURSOR ON
  23. @ row, col SAY ""               && Restore cursor position.
  24. RETURN (drive)
  25.